<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
	protected function _initAutoload()
	{
		$autoload = new Zend_Application_Module_Autoloader(array('namespace'=>'','basePath'=>APPLICATION_PATH));
		return $autoload;
	}
	protected  function _initDb()
	{
		$dbOption = $this->getOption('resources');
		$dbOption = $dbOption['db'];
		$db = Zend_Db::factory($dbOption['adapter'],$dbOption['params']);
		$db->setFetchMode(Zend_Db::FETCH_ASSOC);
		$db->query("SET NAMES 'utf8'");
		$db->query("SET CHARACTER SET 'utf8'");
		Zend_Registry::set('connectDB', $db);
		Zend_Db_Table::setDefaultAdapter($db);
		Zend_Db_Table_Abstract::setDefaultAdapter($db);
		return $db;
	}
	protected  function _initSession()
	{
		$session = Zend_Session::start();
		return $session;
	}
}

